﻿using Newtonsoft.Json.Linq;

namespace Art_To_Eagle.Lib.EagleLib.Structure
{
    class ApplicationInfo
    {
        public string Version { private set; get; }
        public string PrereleaseVersion { private set; get; }
        public string BuildVersion { private set; get; }
        public string ExecPath { private set; get; }
        public string Platform { private set; get; }

        public ApplicationInfo(string data)
        {
            var info = JObject.Parse(data);
            if ((string)info["status"] == "success")
            {
                Version = (string)info["data"]["version"];
                PrereleaseVersion = (string)info["data"]["prereleaseVersion"];
                BuildVersion = (string)info["data"]["buildVersion"];
                ExecPath = (string)info["data"]["execPath"];
                Platform = (string)info["data"]["platform"];
            }
        }
    }
}
